package com.hengpeng.itfin.tools;

import java.util.Collection;

/**
 * <pre>
 * 计算工具类
 * </pre>
 * @author chenjian
 * @version 1.0, 2011-8-20
 */
public class Tools
{
	public static boolean validateObjectsNullOrEmpty(Object... obj)
	{
		if (obj == null)
			return true;
		for (Object o : obj)
		{
			boolean isEmpty;
			if (o instanceof String)
			{
				isEmpty = o.toString().trim().equals("");
			}
			else if (o instanceof Collection<?>)
			{
				Collection<?> list = (Collection<?>) o;
				isEmpty = list.size() == 0;
			}
			else
			{
				isEmpty = (o == null);
			}
			if (isEmpty)
				return true;
		}
		return false;
	}
}
